package com.example.cartmanage.cart

import androidx.recyclerview.widget.LinearLayoutManager
import com.alibaba.android.arouter.facade.annotation.Route
import com.blankj.utilcode.util.ToastUtils
import com.example.cartmanage.chewei.adapter.CheLiangAdapter
import com.example.cartmanage.databinding.ActivityCartManageBinding
import com.example.lib_base.mvvm.BaseActivity
import dagger.hilt.android.AndroidEntryPoint

@Route(path = "/cartmanage/CartManageActivity")
@AndroidEntryPoint
class CartManageActivity : BaseActivity<ActivityCartManageBinding, CartManageViewModel>() {
    private val cheliangAdapter=CheLiangAdapter(mutableListOf())
    override fun initView() {
        vm.cheLiang("津A35675")
        binding.rvParkManager.layoutManager=LinearLayoutManager(this)
        binding.rvParkManager.adapter=cheliangAdapter
    }
    override fun initData() {
        vm.CartListSuccess.observe(this){
            ToastUtils.showShort(it.size)
        }
        vm.CheLiangSuccess.observe(this){
            cheliangAdapter.updateData(it)
            ToastUtils.showShort("成功")
        }
    }
}